<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/js/sweetalert2.js"></script>
    <title><?php echo $title; ?></title>
</head>
<body>
</body>
<script type="text/javascript">
    Swal.fire({
        position: 'center',
        <?php if($success) : ?>
        icon: 'success',
        showConfirmButton: false,
        timer: 1500,
        <?php else : ?>
        icon: 'error',
        showConfirmButton: true,
        <?php endif; ?>
        title: '<?php echo $title; ?>',
        text: "<? echo $message; ?>"
    }).then(() => {
        <?php if (is_null($backUrl)) : ?>
        window.history.back();
        <?php else : ?>
        window.location.href = '<?php echo $backUrl; ?>';
        <?php endif; ?>
    }); 
</script>
</html>
